// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "FreezeTime.generated.h"


UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class MISCELLANEOUSPROJECT_API UFreezeTime : public UActorComponent
{
	GENERATED_BODY()

public:	
	UFreezeTime();

protected:
	virtual void BeginPlay() override;
public:
	UFUNCTION(BlueprintCallable, Category = TimeAndSpace)
		void ActivateAbility();
	UFUNCTION(BlueprintCallable, Category = TimeAndSpace)
		void DeactivateAbility();

private:
	void Trace(TArray<FHitResult>& HitResultes);
	void SetOwnerTimeDilation(float TimeDilation);
private:
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = TimeAndSpace, meta = (AllowPrivateAccess = "true"))
	bool IncludePlayer;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = TimeAndSpace, meta = (AllowPrivateAccess = "true"))
	bool UseTrace;	
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = TimeAndSpace, meta = (AllowPrivateAccess = "true"))
	FPostProcessSettings PPSettings;

	bool IsFreezeTimeActive;
	float FreezeValue;
	float FreezePlayerValue;
	class ACharacter* Character;
	TArray<AActor*> HitActors;
	TArray<FVector> Velocity;	
};
